#include<cstdio>
#include<algorithm>
#define openfile(s) freopen(s".in","s",stdin);freopen(s".out","w",stdout)
using namespace std;
const int N=1e6+1;
long long read()
{
	long long ret=0;
	char c=getchar();
	for(;c<'0' || c>'9';c=getchar());
	for(;c>='0' && c<='9';ret=ret*10+c-'0',c=getchar());
	return ret;
}
int n,h[N],r[N],rr[N];
long double depth[N];
int q[N],t;
long double calc(int x,int y)
{
	long double k=1.0*h[x]/(rr[x]-r[x]),b=-r[x]*k;
	long double kk=1.0*h[y]/(rr[y]-r[y]),bb=-r[y]*kk;
	long double h1=rr[y]*k+b,h2=rr[x]*kk+bb;
	long double ret;
	if(r[x]<=rr[y] && rr[y]<=rr[x] && kk<=k && h[y]<=h1)
	{
		ret=h1-h[y];
	}
	else if(r[y]<=rr[x] && rr[x]<=rr[y] && kk<=k && h2<=h[x])
	{
		ret=h[x]-h2;
	}
	else
	{
		ret=min(max(0.0L,k*r[y]+b),1.0L*h[x]);
	}
	return ret+depth[x];
}
int type(int x,int y)
{
	return calc(x,y)+h[y]>=depth[x]+h[x];
}
void work()
{
	n=read();
	for(int i=1;i<=n;i++)
	{
		h[i]=read();
		r[i]=read();
		rr[i]=read();
	}
	q[t++]=1;
	long double ans=h[1];
	for(int i=2;i<=n;i++)
	{
		for(;t && type(q[t-1],i);t--,depth[i]=max(depth[i],calc(q[t],i)));
		if(t)
		{
			depth[i]=max(depth[i],calc(q[t-1],i));
		}
		q[t++]=i;
		ans=max(ans,depth[i]+h[i]);
	}
	printf("%.12Lf",ans);
	return;
}
int main()
{
	freopen("data.txt","r",stdin);
	openfile("wan");
	work();
	return 0;
}
